package com.example.practica1;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class MainActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		
		Button button1 = (Button) findViewById(R.id.Boton1);
		Button button2 = (Button) findViewById(R.id.Boton2);

		button1.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MainActivity.this, Activity9.class);
				startActivity(intent);
			}

		});

		button2.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

					Intent intent = new Intent(MainActivity.this,
							Activity8.class);
					startActivity(intent);
				
			}

		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);

		menu = (Menu) findViewById(R.id.Informacion);

		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		Intent i = new Intent(MainActivity.this, Activity7.class);

		Log.i("Got into onOptionsItemSelected", "Yes");
		switch (item.getItemId()) {

		case R.id.Reglas:

			i.putExtra("Menu", 1);
			startActivity(i);

			System.out.println("REGLAS");

			return true;

		case R.id.Informacion:
			i.putExtra("Menu", 2);
			startActivity(i);

			System.out.println("INFORMACION");

			return true;

		case R.id.VistaReglas:
			i.putExtra("Menu", 3);
			startActivity(i);

			System.out.println("REGLAS GRAFICAS");

			return true;

		case R.id.Score:
			i.putExtra("Menu", 4);
			startActivity(i);

			System.out.println("SCORE");

			return true;

		}
		return false;

	}
}